package com.gitpull.mapper;

import com.gitpull.pojo.gitInfo;
import com.gitpull.pojo.student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface excelMapper {

    @Update("DROP TABLE IF EXISTS student")
    void dropStudentTableIfExists();

    @Update("DROP TABLE IF EXISTS gitinfo")
    void dropGitInfoTableIfExists();

    @Update("CREATE TABLE student (" +
            "submission_time DATETIME, " +
            "id  VARCHAR(255) , " +
            "answer_time VARCHAR(255), " +
            "name VARCHAR(255), " +
            "student_number VARCHAR(255), " +
            "warehouse_address VARCHAR(255), " +
            "topic VARCHAR(255), " +
            "summarize VARCHAR(255))")
    void createStudentTable();

    @Update("CREATE TABLE gitinfo (" +
            "student_number VARCHAR(255), " +
            "info VARCHAR(255), " +
            "versionnumber VARCHAR(255), " +
            "author VARCHAR(255), " +
            "email VARCHAR(255))")
    void createGitInfoTable();

    void saveExcel(List<student> userList);

    void saveExcelInfo(List<gitInfo> gitInfos);
}
